﻿using UnityEngine;

namespace Assets.Scripts.Example_2
{
    public class Player3:BaseComponent
    {
        public GameObject m_Obj;
        private int i = 0;

        private float _beginTime = 0;
        private bool _beginCountDown = false;
        public void Init(bool useTimer)
        {
            BeginCountDown(useTimer);
        }

        private void BeginCountDown(bool useTimer)
        {
            if (useTimer)
            {
                MainEnter.GetTimer().AddEvent(OnCountDown, null, 10000);
            }
            else
            {
                _beginTime = Time.realtimeSinceStartup;
                _beginCountDown = true;
            }
        }

        private void OnCountDown(object obj)
        {
        }

        protected override void OnUpdate(float deltaTime)
        {
            if (_beginCountDown)
            {
                if (Time.realtimeSinceStartup - _beginTime > 10000)
                {
                    
                }
            }
        }
    }
}